/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package AbstractFactory;

/**
 *
 * @author David
 */
public class CountFoldersLinux implements CountFolders {

    String s;
    public CountFoldersLinux(String s){
      this.s =s ;  
    }
    
    @Override
    public void count() {
        int nbFolders=0;
        for(int i=0; i<s.length();i++){
            if(s.charAt(i) == '/')
            nbFolders++;
        }
        System.out.println(nbFolders-1);
    }
    
}
